package com.wench.design.pattern.singleton.lazy.demo1;

/**
 * 懒汉式：线程不安全/安全
 *
 * @author wench
 */
public class Singleton {

    private Singleton() {
    }

    private static Singleton instance;

    public static synchronized Singleton getInstance() {
        if (instance == null) {
            instance = new Singleton();
        }
        return instance;
    }
}
